package io_exercise;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo2 {
    public static void main(String[] args) throws IOException {
        String name2="ls";
        int age2=26;
        String gender2="女";
        String[] otherInfo2={"是一名学生","家住天津","喜欢看书"};
        Student2 ls=new Student2(name2,age2,gender2,otherInfo2);
        System.out.println(ls);

        FileOutputStream fos2=new FileOutputStream("student2.obj");
        ObjectOutputStream oos2=new ObjectOutputStream(fos2);
        oos2.writeObject(ls);
        System.out.println("写出完毕!");
        oos2.close();
    }
}
